package com.wanyu.video.netty.http;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

public class NettyHttpServerInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {

        // 管道中加HTTP入处理器, 以及自定http解析器
        ch.pipeline().addLast("MyHttpServerCodec", new HttpServerCodec())
                .addLast("MyNettyHttpServerHandler", new NettyHttpServerHandler());



    }
}
